package com.campus.backend.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.campus.common.mybatis.entity.IntegerIdBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 优惠券表
 * </p>
 *
 * @author ZhaoYuJie
 * @since 2025-05-12
 */
@Getter
@Setter
@TableName("coupon")
@ApiModel(value = "Coupon对象", description = "优惠券表")
public class Coupon extends IntegerIdBaseEntity<Coupon> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("优惠券名称")
    @TableField("name")
    private String name;

    @ApiModelProperty("类型：1-满减券，2-折扣券")
    @TableField("type")
    private Integer type;

    @ApiModelProperty("面值/折扣值")
    @TableField("value")
    private BigDecimal value;

    @ApiModelProperty("最低消费")
    @TableField("min_consume")
    private BigDecimal minConsume;

    @ApiModelProperty("使用开始时间")
    @TableField("use_start_time")
    private LocalDateTime useStartTime;

    @ApiModelProperty("使用结束时间")
    @TableField("use_end_time")
    private LocalDateTime useEndTime;

    @ApiModelProperty("描述")
    @TableField("description")
    private String description;

    @ApiModelProperty("发行量")
    @TableField("total")
    private Integer total;

    @ApiModelProperty("剩余数量")
    @TableField("remain")
    private Integer remain;

    @ApiModelProperty("发放类型：1-自动发放，2-手动领取")
    @TableField("issue_type")
    private Integer issueType;

    @ApiModelProperty("发放条件：new_user-新用户注册，first_order-首次下单，activity-活动优惠券")
    @TableField("issue_condition")
    private String issueCondition;

    @ApiModelProperty("领取开始时间")
    @TableField("receive_start_time")
    private LocalDateTime receiveStartTime;

    @ApiModelProperty("领取结束时间")
    @TableField("receive_end_time")
    private LocalDateTime receiveEndTime;

    @ApiModelProperty("每人限领数量")
    @TableField("receive_limit_num")
    private Integer receiveLimitNum;

    @ApiModelProperty("状态：1-正常，0-失效")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @Override
    public Serializable pkVal() {
        return null;
    }
}
